﻿<%@ Page Language="C#" MasterPageFile="~/ExampleMaster.Master" AutoEventWireup="true"
    CodeBehind="IndexSelect.aspx.cs" Inherits="Web.Samples.IndexSelect" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleZone" runat="server">
    Indexed Select
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="IntroTextZone" runat="server">
    Using an Index select it is possible to gain access to the number within the sequence
    the current object holds. Below we will return a list of 10 customers as well as
    the order they come back to us in.
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="QueryExpressZone" runat="server">
    <div class="bold">No Sample Available</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="QueryResultsZone" runat="server">
    <asp:Literal ID="litQueryZone" runat="server" />
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ImperativeZone" runat="server">
    <pre class="code">            <span style="color: rgb(0,0,255)">var</span> query = <span
        style="color: rgb(43,145,175)">Customer</span>.GetCustomers().Select((c, index) =&gt; <span
            style="color: rgb(0,0,255)">new</span> { Index = index, Name = c.AccountNumber});

            <span style="color: rgb(0,0,255)">foreach</span> (<span style="color: rgb(0,0,255)">var</span> o <span
                style="color: rgb(0,0,255)">in</span> query)
                <span style="color: rgb(0,0,255)">this</span>.litImperativeResults.Text += <span
                    style="color: rgb(0,0,255)">string</span>.Format(<span style="color: rgb(163,21,21)">"Index:
                        {0} Acct Number: {1}&lt;br /&gt;\n"</span>, o.Index, o.Name);</pre>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="ImperativeResultsZone" runat="server">
    <asp:Literal ID="litImperativeResults" runat="server" />
</asp:Content>
